<!--
 * @Description:
 * @Author: dh
 * @Date: 2022-03-15 14:09:18
 * @LastEditors: dh
 * @LastEditTime: 2022-03-15 14:10:22
-->
<template>
	<view class="content">
		<view id="go" @click="go">事件跳转</view>
		<navigator open-type="navigate" url="../map/map?name=deng">组件跳转</navigator>
		<navigator open-type="navigate" url="/pages/refresh/refresh">跳转刷新页面</navigator>
		<navigator open-type="navigate" url="/pages/scroll-view/scroll-view">跳转滚动页面</navigator>
		<navigator open-type="navigate" url="/pages/vuex/vuex">跳转vuex页面</navigator>
		<view class="">
			<Test :obj="obj" @change="change" />
		</view>
	</view>
</template>

<script>
	import Test from "../../components/test/test.vue";
	export default {
		data() {
			return {
				obj: [{
					num: 0
				}, {
					num: 0
				}],
			};
		},
		components: {
			Test,
		},
		onLoad() {
			console.log("运行环境:" + process.env.NODE_ENV);
			console.log("运行平台:" + uni.getSystemInfoSync().platform);

			// #ifdef H5
			// alert("只有h5平台才有alert方法")
			// #endif
		},
		methods: {
			go() {
				uni.navigateTo({
					url: "../map/map",
					// url: "/pages/map/map",
				});
				// this.$router.push('/pages/map/map')
			},
			change(index, data) {
				this.$set(this.obj, index, data);
			},
		},
	};
</script>

<style lang="scss">
	#go {
		color: $themColor;
	}

	page {
		text-align: center;
	}
</style>
